package 文件.学习;

import java.io.File;

public class 文件的删除 {
    public static void main(String[] args) {
        //1.创建一个File对象
        File f1=new File("D:\\F\\aaa.txt");
        //2.删除文件-->删除后是不能在回收站找到的,直接完全删除
        boolean delete = f1.delete();
        System.out.println(delete);//true

        //3.删除文件夹
        File f2=new File("D:\\F\\AAA");
        boolean delete1 = f2.delete();
        System.out.println(delete1);//true

        //4.删除含有文件的文件夹
        File f3=new File("D:\\F\\CCC");
        boolean delete2 = f3.delete();
        System.out.println(delete2);//false


    }
}
